<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="/person/css/common.css"/>
    <script type="text/javascript" src="/person/js/jquery.1.9.1.js" ></script>
   <script type="text/javascript" src="/plan/js/layer.js" ></script>
    <script type="text/javascript" src="/person/js/mobileSelect.js"></script>
	<link rel="stylesheet" type="text/css" href="/person/css/mobileSelect.css"/>
	<script type="text/javascript" src="/person/js/rem.js" ></script>
    <title>参会人员</title>
</head>
<style>
.jt{margin: 0.14rem 0.1rem 0 0;}
</style>
<body>
	<div class="session_top">{$info->department_text}的开会计划</div>
	<ul class="order_money" style="padding: 0 0.3rem;background: #fff;margin-top: 0.2rem;">
	    <li>
			<span class="type" style="font-size: 0.2rem;">{:__('Division_method')}</span><span class="jt"></span>
			<div id="trigger1" class="trigger1" style="display: inline-block;width: 96%;">
			 	{$info->division_method_text}
			</div>
			<input type="hidden" name="" id="tfbd" value="{$info->division_method}" />								
		</li>
		 <li>
			<span class="fontchang" style="font-size: 0.2rem;">{:__('Division_method_round')}</span><span class="jt"></span>
			<div id="trigger2" class="trigger2" style="display: inline-block;width: 96%;">
			 	{$info->division_method_round_text}
			</div>
			<span class="help-block" style="font-size: 0.2rem;color: #c2c2c2;">{:__('Note_round')}</span>
			<input type="hidden" name="" id="yilunshu" value="{$info->division_method_round}" />								
		</li>
	</ul>
	
			
	<ul class="session_list">
		<li>参会人员管理
			{if isset($WeekModel['Score'][$type]['add'])&&  ($plan_auth['department'] == $info['department'])}
			<a href="/index/plan/public_add/type/{$type}/ids/{$ids}"><img class="add" src="/person/img/jia.png" /></a>
			{/if}
		</li>
	  <?php if(!empty($WeekInfo[$type])){?>
		<?php foreach($WeekInfo[$type] as $key=>$val){?>
		
		<li id="user_{$val['id']}">
			{if isset($WeekModel['Score'][$type]['edit']) &&  ($plan_auth['department'] == $info['department'])}
			<a href="/index/plan/public_edit/type/{$type}/ids/{$val['id']}">
			{else}
			<a href="javascript:;">
			{/if}
				{if($val['thumb_avatar'])}
				<img class="tx" src="{$val['thumb_avatar']}"/>
				{else}
				<img class="tx" src="{$val['avatar']}"/>
				{/if}
			</a>
			<span class="session_info">{$val['username_text']}&nbsp;&nbsp;|&nbsp;&nbsp;<span>{$val['position_text']}</span></span>
			{if isset($WeekModel['Score']['User']['delete']) &&  ($plan_auth['department'] == $info['department'])}
			
			<img class="cut" attrid="{$val['id']}" src="/person/img/cut.png" />
			{/if}
		</li>
		 <?php }?>
	  <?php }?>
		
	</ul>
	{if AdminAuth('finance/extract/week/add') &&  ($plan_auth['department'] == $info['department'])  &&  $info['status'] < 3}
		<div class="preserve">提交</div>
	{/if}
</body>
<script>
$(function(){
	$('.cut').click(function(){
		var ids = $(this).attr("attrid");
		var index = layer.open({type: 2});
		$.ajax({
		  type: 'post',
		  url:"/index/plan/public_delete/type/User/ids/"+ids,
		  dataType: "json",
		  success: function(data){
		  	if(data.code == 1){
		  		$("#user_"+ids).remove();
		  	}
			layer.open({
				content:data.msg,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			layer.close(index);
		  }
		});
		
		
	});
	//提交表单
	$('.preserve').click(function(){
		var tfbd = $('#tfbd').val();
		var yilunshu = $('#yilunshu').val();
		if(tfbd == ''||tfbd == null){
			layer.open({
				content:'请选择提分宝典分成方式' ,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false;
		}
		if(yilunshu == ''||yilunshu == null){
				layer.open({
				content:'请选择一轮书分成方式' ,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false;
		}
		$.ajax({
		  type: 'post',
		  url:"/index/plan/public_edit/type/User2/ids/"+{$ids},
		  data:{division_method:tfbd,division_method_round:yilunshu},
		  dataType: "json",
		  success: function(data){
		    layer.open({
				content:data.msg,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
		  }
		});
	 });
	var division_method = {$info.division_method}-1;
	//选择
	var mobileSelect1 = new MobileSelect({
	    trigger: '#trigger1',
	    title: '提分宝典',
	    wheels: [{data:[
	    					{
	                        id:'1',
	                        value:'人均'
	                    },
	                    {
	                        id:'2',
	                        value:'百分比'
	                    }
	    			]}],
	     position:[division_method],
		 callback:function(indexArr, data){
		    $('#tfbd').val(data[0].id);
		    $('.type').css('font-size','0.2rem');
		 }  
	});
	var division_method_round = {$info.division_method_round}-1;
	var mobileSelect2 = new MobileSelect({
	    trigger: '#trigger2',
	    title: '一轮书',
	    wheels: [{data:[
	    					{
	                        id:'1',
	                        value:'人均'
	                    },
	                    {
	                        id:'2',
	                        value:'百分比'
	                    }
	    			]}],
	    position:[division_method_round],
		 callback:function(indexArr, data){
		    $('#yilunshu').val(data[0].id);
		    $('.fontchang').css('font-size','0.2rem');
		 }  
	});
});
</script>
</html>
